#ifndef SERVICE_TIMER_H
#define SERVICE_TIMER_H
class Service;
class ServiceTimer;
struct event;
class ServiceTimerHandler {
public:
	virtual void onServiceTimer(ServiceTimer* timer) = 0;
};

class ServiceTimer
{
public:
	~ServiceTimer();

private:
	friend Service;
	ServiceTimer(Service* service, ServiceTimerHandler* handler, int timeOut, bool repid = false);
private:
	static void onTimer(int fd, short ev, void* args);

private:
	event* m_tmr;
	Service* m_service;
	ServiceTimerHandler* m_handler;
	bool m_repid;
	int m_timeout;
};
#endif
